package Thread01;

public class dome {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            while (true){
                try {
                    Thread.sleep(1000);
                    System.out.println("hello t");
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });

        Thread t1 = new Thread(()->{
            while (!Thread.currentThread().isInterrupted()){
//                try {
//                    Thread.sleep(1000);
                    System.out.println("hello t1");
//                } catch (InterruptedException e) {
//                    throw new RuntimeException(e);
//                }
            }
        });

        System.out.println(t.getState());

        t.start();
        t1.start();
        t1.interrupt();
//        System.out.println(t.getState());

        t.join();
//        Thread.sleep(3000);
        System.out.println(t.getState());

    }
}
